<?php
defined('_JEXEC') or die;
?>

<h2 class="titlepage">Kostvaner/ ønsker</h2>
<h3 class="title-step-page">Kostvaner/ ønsker</h3>
<div class="eachBox creater-user-box clearfix">
    <div class="cont-box">
        <form name="reg_form2" id="member-edit" action="index.php" method="post" class="form-validate" enctype="multipart/form-data">
        <div class="wrapCreaterUser step-2">
            <div class="col-info-1 spisevaner">
                <h6>Nuværende spisevaner:</h6>
                <?php
                $tmp='';
                $tmp1=' checked';
                $tmp2=' hide';
                if($breakfast){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
                ?>
                <div class="eachRow eachQuestion clearfix">
                    <div class="question">Spiser du morgenmad regelmæssigt?</div>
                    <span class="uper">Ja/Nej</span>
                    <input type="radio" class="radioip no" name="r1" value="0" <?php echo $tmp1;?> />
                    <input type="radio" class="radioip yes" name="r1" value="1" <?php echo $tmp;?> />
                    <div class="in-question clearfix <?php echo $tmp2;?>" id="opt1" >
                        <p class="in-lb">Hvis ja, hvad spiser du?</p>
                        <input class="txtip mw100" type="text" name="jform[breakfast]" value="<?php echo $breakfast?>">
                    </div>
                </div>
                <?php
                $tmp='';
                $tmp1=" checked";
                $tmp2=' hide';
                if($soda){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
                ?>
                <div class="eachRow eachQuestion clearfix">
                    <div class="question">Drikker du sodavand?</div>
                    <span class="uper">Ja/Nej</span>
                    <input type="radio" class="radioip no" name="r2" value="" <?php echo $tmp1?>>
                    <input type="radio" class="radioip yes" name="r2" value="1" <?php echo $tmp?>>
                    <div class="in-question clearfix <?php echo $tmp2;?>" id="opt2">
                        <p class="in-lb">Hvis ja, hvor meget ca. pr. dag?</p>
                        <input class="txtip mw100" type="text" name="jform[soda]" value="<?php echo $soda?>">
                    </div>
                </div>
                <?php
                $tmp='';
                $tmp1=" checked";
                $tmp2=' hide';
                if($eatwell){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
                ?>
                <div class="eachRow eachQuestion clearfix">
                    <div class="question">Mener du, at du spiser nogenlunde sundt</div>
                    <span class="uper">Ja/Nej</span>
                    <input type="radio" class="radioip no" name="r3" value=""<?php echo $tmp1?> >
                    <input type="radio" class="radioip yes" name="r3" value="1"<?php echo $tmp?>>
                    <div class="in-question clearfix <?php echo $tmp2;?>" id="opt3">
                        <p class="in-lb">Hvor stor en procentdel af det du indtager, mener du er sundt?</p>
                        <input class="txtip mw100" type="text" name="jform[eatwell]" value="<?php echo $eatwell?>">
                    </div>
                </div>
                <?php
                $tmp='';
                $tmp1=" checked";
                $tmp2=' hide';
                if($roiloan!=""){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
                ?>
                <div class="eachRow eachQuestion clearfix">
                    <div class="question">Har du nogen form for spiseforstyrrelser</div>
                    <span class="uper">Ja/Nej</span>
                    <input type="radio" class="radioip no" name="r4" value=""<?php echo $tmp1?>>
                    <input type="radio" class="radioip yes" name="r4" value="1"<?php echo $tmp?>>
                <?php
                if($roiloan==""){$tmp='';$tmp1="";}
                elseif($roiloan==1){$tmp1='';$tmp=" checked";}
                elseif($roiloan===0){$tmp='';$tmp1=" checked";}
                ?>
                    <div class="in-question question-noip clearfix <?php echo $tmp2?>" id="opt4">
                        <p class="in-lb">Hvis ja, har du fået eller får du hjælp?</p>
                        <span class="uper">Ja/Nej</span>
                        <input type="radio" class="radioip" name="r5" name="jform[roiloan]" value="0"<?php echo $tmp1?>>
                        <input type="radio" class="radioip" name="r5" name="jform[roiloan]" value="1"<?php echo $tmp?>>
                    </div>
                </div>
            </div>
            
            <!--col-info-1-->
            <div class="col-info-2">
                <div class="form-kostvaner kostvaner-2">
                    <h6>Mulige kostvaner:</h6>
                    <p>Hvornår på dagen har du mulighed for at spise</p>
                    <div class="eachRow clearfix">
                        <div class="eachInput divi-col divi-1-3 m-l-0">
                            <p>&nbsp;</p>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <p>Fra kl.</p>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <p>Til kl.</p>
                        </div>
                    </div>
                    <div class="eachRow clearfix">
                        <div class="eachInput divi-col divi-1-3 m-l-0">
                            <p>Måltid 1:</p>
                        </div>
                        <div class="eachInput divi-col divi-1-3" >
                            <select class="select-sl" name="jform[meal1a]">
                                <?php
                                selectpair(2,10,$meal1[0]);
                                ?>
                            </select>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal1b]">
                                <?php
                                selectpair(3,11,$meal1[1]);
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="eachRow clearfix">
                        <div class="eachInput divi-col divi-1-3 m-l-0">
                            <p>Måltid 2:</p>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal2a]">
                                <?php
                                selectpair(9,17,$meal2[0]);
                                ?>
                            </select>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal2b]">
                                <?php
                                selectpair(10,18,$meal2[1]);
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="eachRow clearfix">
                        <div class="eachInput divi-col divi-1-3 m-l-0">
                            <p>Måltid 3:</p>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal3a]">
                                <?php
                                selectpair(11,21,$meal3[0]);
                                ?>
                            </select>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal3b]">
                                <?php
                                selectpair(12,22,$meal3[1]);
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="eachRow clearfix">
                        <div class="eachInput divi-col divi-1-3 m-l-0">
                            <p>Måltid 4:</p>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal4a]">
                                <?php
                                selectpair(13,22,$meal4[0]);
                                ?>
                            </select>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal4b]">
                                <?php
                                selectpair(14,23,$meal4[1]);
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="eachRow clearfix">
                        <div class="eachInput divi-col divi-1-3 m-l-0">
                            <p>Måltid 5:</p>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal5a]">
                                <?php
                                selectpair(14,22,$meal5[0]);
                                ?>
                            </select>
                        </div>
                        <div class="eachInput divi-col divi-1-3">
                            <select class="select-sl" name="jform[meal5b]">
                                <?php
                                selectpair(15,23,$meal5[1]);
                                ?>
                            </select>
                        </div>
                    </div>
                    <div class="extra-ques">
                        <p>Er det vigtigt, at den kost du indtager, er varierende og smagsfuld?</p>
                        <label class="blradio">
                            <input class="radioip" type="radio" name="ques" name="jform[diversity]" value="-1">
                            Ikke vigtigt</label>
                        <label class="blradio">
                            <input class="radioip" type="radio" name="ques" name="jform[diversity]" value="1">
                            Meget vigtigt</label>
                        <label class="blradio">
                            <input class="radioip" type="radio" name="ques" name="jform[diversity]" value="0">
                            Ingen af delene</label>
                    </div>
                </div>
                <!--form-kostvaner--> 
            </div>
            <!--col-info-2-->
            <div class="col-info-3">
                <div class="form-kostvaner kostvaner-3">
                    <h6>Mulige kostvaner:</h6>
                    <div class="eachRow eachInput selectlist sl-time clearfix">
                        <p>Hvor meget tid vil du ca. bruge  på at lave mad pr. dag?</p>
                        <select class="select-sl" name="jform[cooktime]">
                            <option value="0">0 min</option>
                            <option value="30">30 min</option>
                            <option value="45">45 min</option>
                            <option value="60">60 min</option>
                            <option value="90">90 min</option>
                            <option value="120">2 timer</option>
                            <option value="180">+3 timer</option>
                        </select>
                    </div>
                    <?php
                    $fav=explode("-",$fav);
                    $fav[0]= explode(",", $fav[0]);
                    $fav[1]=explode(",", $fav[1], count($fav[0]));
                    $fav=array_combine($fav[0], $fav[1]);
                    ?>
                    <p>Hvilke fødevarer kan du lide?</p>
                    <div class="choice foods clearfix">
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label>
                            <p>Kylling</p>
                            <input class="ck" type="checkbox" name="jform[fav][0]" value="Kylling"<?php echo $fav[0] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label>
                            <p>Rodfrugter</p>
                            <input class="ck" type="checkbox" name="jform[fav][1]" value="Rodfrugter"<?php echo $fav[1] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label>
                            <p>Oksekød</p>
                            <input class="ck" type="checkbox" name="jform[fav][2]" value="Oksekød"<?php echo $fav[2] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label>
                            <p>Chili</p>
                            <input class="ck" type="checkbox" name="jform[fav][3]" value="Chili"<?php echo $fav[3] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label>
                            <p>Svinekød</p>
                            <input class="ck" type="checkbox" name="jform[fav][4]" value="Svinekød"<?php echo $fav[4] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label>
                            <p>Proteinpulver</p>
                            <input class="ck" type="checkbox" name="jform[fav][5]" value="Proteinpulver"<?php echo $fav[5] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label>
                            <p>Brune ris</p>
                            <input class="ck" type="checkbox" name="jform[fav][6]" value="Brune ris"<?php echo $fav[6] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label>
                            <p>Æg</p>
                            <input class="ck" type="checkbox" name="jform[fav][7]" value="Æg"<?php echo $fav[7] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label>
                            <p>Grønne bønner</p>
                            <input class="ck" type="checkbox" name="jform[fav][8]" value="Grønne bønner"<?php echo $fav[8] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label>
                            <p>Fisk</p>
                            <input class="ck" type="checkbox" name="jform[fav][9]" value="Fisk"<?php echo $fav[9] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label>
                            <p>Ost</p>
                            <input class="ck" type="checkbox" name="jform[fav][10]" value="Ost"<?php echo $fav[10] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label>
                            <p>Nødder</p>
                            <input class="ck" type="checkbox" name="jform[fav][11]" value="Nødder"<?php echo $fav[11] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2 m-l-0">
                            <label>
                            <p>Hakket kød <br>
                                (svin/kalvekød/ okse)</p>
                            <input class="ck" type="checkbox" name="jform[fav][12]" value="Hakket kød (svin/kalvekød/okse)"<?php echo $fav[12] ? ' checked=""':""?>>
                            </label>
                        </div>
                        <div class="eachInput divi-col divi-1-2">
                            <label>
                            <p>Mælkeprodukter <br>
                                (ymer, fromage frais etc.)</p>
                            <input class="ck" type="checkbox" name="jform[fav][13]" value="Mælkeprodukter (ymer, fromage frais etc.)"<?php echo $fav[13] ? ' checked=""':""?>>
                            </label>
                        </div>
                    </div>
                    <!-- choice foods-->
                    <div class="eachRow eachQuestion clearfix">
                        <div class="question">Er du allergisk overfor nogle fødevarer?</div>
                        <?php if($allergy){?>
                        <span class="uper">Ja/Nej</span>
                        <input type="radio" class="radioip no" name="r5" value="1" checked="checked">
                        <input type="radio" class="radioip yes" name="r5">
                        <div class="in-question clearfix" id="opt5">
                            <p class="in-lb">Hvis ja, hvad?</p>
                            <input class="txtip mw100" type="text" name="jform[allergy]" value="<?php echo $allergy?>">
                        </div>
                        <?php } else {?>
                        <span class="uper">Ja/Nej</span>
                        <input type="radio" class="radioip no" name="r5" value="1" >
                        <input type="radio" class="radioip yes" name="r5" checked="checked">
                        <div class="in-question clearfix" id="opt5">
                            <p class="in-lb">Hvis ja, hvad?</p>
                            <input class="txtip mw100" type="text" name="jform[allergy]">
                        </div>
                        <?php }?>
                    </div>
                    <!-- eachQuestion--> 
                </div>
                <!--form-kostvaner--> 
            </div>
            <!--col-info-3--> 
        </div>
        <!--wrapCreaterUser-->
        <div class="wrap-btn-cru clearfix"> <a class="btnGreen bntNext bntPrevious left" href="<?php echo JRoute::_('index.php?option=com_users&view=profile&layout=edit&Itemid=117')?>"><span class="iconext"><img src="templates/fitplan/src_mobile/images/iconBack.png"></span> FORRIGE</a> <a class="btnGreen bntNext right" onclick="$('#member-edit').submit()"> Næste <span class="iconext"><img src="templates/fitplan/src_mobile/images/iconNext.png"></span></a> </div>
        <input type="hidden" name="option" value="com_users" />
        <input type="hidden" name="task" value="profile.edit" />
        <input type="hidden" name="user_id" value=<?php echo $user->id?> />
        <?php echo JHtml::_('form.token');?>
    </form>        
    </div>
    <!-- cont-boX--> 
</div>
<script type="text/javascript">
var f2=document.reg_form2;
	$(document).ready(function(){
		$("input[name=r1]").change(function() {
			$("#opt1").toggle();
			if(!$(this).val())
				f2.elements["jform[breakfast]"].value="";
		});

		$("input[name=r2]").change(function() {
			$("#opt2").toggle();
			if(!$(this).val())
				f2.elements["jform[soda]"].value="";
		});

		$("input[name=r3]").change(function() {
			$("#opt3").toggle();
			if(!$(this).val())
				f2.elements["jform[eatwell]"].value="";
		});

		$("input[name=r4]").change(function(){
			$("#opt4").toggle();
			if(!$(this).val()){
				f2.elements["jform[roiloan]"][0].checked=false;
				f2.elements["jform[roiloan]"][1].checked=false;
			}
		});

		$("input[name=r5 ]").change(function() {
			$("#opt5").toggle();
			if(!$(this).val())
				f2.elements["jform[allergy]"].value="";
		});
	});
<?php
	echo 'f2.elements["jform[diversity]"].value=',$diversity,';';
	echo 'f2.elements["jform[cooktime]"].value=',$cooktime,';';
?>
</script>
<?php return;?>
<style type="text/css">
	.w115{width: 115px}
	.ml30{margin-left: 30px}
</style>
<div class="wrapper">
    <div class="content" id="dietaryHabits-page">
        <div class="col-wrapper clearfix">
            <div class="info">
                <ul class="breadcrumb mb20">
                    <li><a href="index.php?option=com_users&view=profile&layout=edit">Personlige oplysninger</a></li>
                    <li class="active"><a>Kostvaner/ønsker</a></li>
                    <li><a href="index.php?option=com_users&view=profile&layout=edit3">Motionsvaner/ønsker</a></li>
                </ul>
                <form name="reg_form2" id="member-edit" action="index.php" method="post" class="form-validate" enctype="multipart/form-data">
                    <h1 class="hd">Kostvaner/ønsker</h1>
                    <div class="colum bor mr27 fl m-h">
                        <div class="col-wra">
                            <div>Nuværende spisevaner:</div>
                            <div>
                                <label>Spiser du morgenmad regelmæssigt?</label>
                            </div>
                            <?php
	$tmp='';
	$tmp1=" checked";
	$tmp2=' class="hide"';
	if($breakfast){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
	?>
                            <div class="fr">
                                <label class="uper">Ja/Nej</label>
                                <input type="radio" class="ra" name="r1" value="1"<?php echo $tmp?>>
                                <input type="radio" class="ra" name="r1" value=""<?php echo $tmp1?>>
                            </div>
                            <div id="opt1"<?php echo $tmp2?>>
                                <label class="fl ita w150">Hvis ja, hvad spiser du?</label>
                                <input class="w86" name="jform[breakfast]" value="<?php echo $breakfast?>">
                            </div>
                        </div>
                        <div class="col-wra">
                            <div style="width: 210px;">
                                <label>Drikker du sodavand?</label>
                            </div>
                            <?php
	$tmp='';
	$tmp1=" checked";
	$tmp2=' class="hide"';
	if($soda){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
	?>
                            <div class="fr">
                                <label class="uper">Ja/Nej</label>
                                <input class="ra" type="radio" name="r2" value="1"<?php echo $tmp?>>
                                <input class="ra" type="radio" name="r2" value=""<?php echo $tmp1?>>
                            </div>
                            <div id="opt2"<?php echo $tmp2?>>
                                <label class="fl ita w150">Hvis ja, hvor meget ca. pr. dag?</label>
                                <input class="w86" name="jform[soda]" value="<?php echo $soda?>">
                            </div>
                        </div>
                        <div class="col-wra">
                            <div style="width: 210px;">
                                <label>Mener du, at du spiser nogenlunde <br>
                                    sundt</label>
                            </div>
                            <?php
	$tmp='';
	$tmp1=" checked";
	$tmp2=' class="hide"';
	if($eatwell){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
	?>
                            <div class="fr">
                                <label class="uper">Ja/Nej</label>
                                <input class="ra" type="radio" name="r3" value="1"<?php echo $tmp?>>
                                <input class="ra" type="radio" name="r3" value=""<?php echo $tmp1?>>
                            </div>
                            <div id="opt3"<?php echo $tmp2?>>
                                <label class="fl ita w150">Hvor stor en procentdel af det du indtager, mener du er sundt?</label>
                                &nbsp;
                                <input name="jform[eatwell]" style="width:22px;margin-left: 60px" value="<?php echo $eatwell?>">
                                &nbsp;% </div>
                        </div>
                        <div class="col-wra">
                            <div>
                                <label>Har du nogen form for spiseforstyrrelser</label>
                                <?php //rối loạn ăn uống, kén ăn?>
                            </div>
                            <?php
	$tmp='';
	$tmp1=" checked";
	$tmp2=' class="hide"';
	if($roiloan!=""){list($tmp,$tmp1) = array($tmp1,$tmp);$tmp2='';}
	?>
                            <div class="fr">
                                <label class="uper">Ja/Nej</label>
                                <input class="ra" type="radio" name="r4" value="1"<?php echo $tmp?>>
                                <input class="ra" type="radio" name="r4" value=""<?php echo $tmp1?>>
                            </div>
                            <div class="clear"></div>
                            <?php
	if($roiloan==""){$tmp='';$tmp1="";}
	elseif($roiloan==1){$tmp1='';$tmp=" checked";}
	elseif($roiloan===0){$tmp='';$tmp1=" checked";}
	?>
                            <div id="opt4"<?php echo $tmp2?> style="float: none">
                                <div>
                                    <label>Hvis ja, har du fået eller får du hjælp?</label>
                                    <?php //đã có ai giúp chưa?>
                                </div>
                                <div class="clear"></div>
                                <div class="fr">
                                    <label class="uper">Ja/Nej</label>
                                    <input class="ra" type="radio" name="jform[roiloan]" value="1"<?php echo $tmp?>>
                                    <input class="ra" type="radio" name="jform[roiloan]" value="0"<?php echo $tmp1?>>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="colum bor mr27 fl m-h">
                        <div class="col-wra">
                            <div>Mulige kostvaner:</div>
                            <div>Hvornår på dagen har du mulighed for at spise</div>
                            <div class="mb0">
                                <div class="fl w100 mt25">Måltid 1:</div>
                                <div class="fl">
                                    <label>Fra kl.</label>
                                    <select name="jform[meal1a]" class="w76">
                                        <?php
selectpair(2,10,$meal1[0]);
?>
                                    </select>
                                </div>
                                <div class="fl ml7">
                                    <label>Til kl.</label>
                                    <select name="jform[meal1b]" class="w76">
                                        <?php
selectpair(3,11,$meal1[1]);
?>
                                    </select>
                                </div>
                            </div>
                            <div class="mb0">
                                <div class="fl w100 mt8">Måltid 2:</div>
                                <div class="fl">
                                    <select name="jform[meal2a]" class="w76">
                                        <?php
selectpair(9,17,$meal2[0]);
?>
                                    </select>
                                </div>
                                <div class="fl ml7">
                                    <select name="jform[meal2b]" class="w76">
                                        <?php
selectpair(10,18,$meal2[1]);
?>
                                    </select>
                                </div>
                            </div>
                            <div class="mb0">
                                <div class="fl w100 mt8">Måltid 3:</div>
                                <div class="fl">
                                    <select name="jform[meal3a]" class="w76">
                                        <?php
selectpair(11,21,$meal3[0]);
?>
                                    </select>
                                </div>
                                <div class="fl ml7">
                                    <select name="jform[meal3b]" class="w76">
                                        <?php
selectpair(12,22,$meal3[1]);
?>
                                    </select>
                                </div>
                            </div>
                            <div class="mb0">
                                <div class="fl w100 mt8">Måltid 4:</div>
                                <div class="fl">
                                    <select name="jform[meal4a]" class="w76">
                                        <?php
selectpair(13,22,$meal4[0]);
?>
                                    </select>
                                </div>
                                <div class="fl ml7">
                                    <select name="jform[meal4b]" class="w76">
                                        <?php
selectpair(14,23,$meal4[1]);
?>
                                    </select>
                                </div>
                            </div>
                            <div class="mb0">
                                <div class="fl w100 mt8">Måltid 5:</div>
                                <div class="fl">
                                    <select name="jform[meal5a]" class="w76">
                                        <?php
selectpair(14,22,$meal5[0]);
?>
                                    </select>
                                </div>
                                <div class="fl ml7">
                                    <select name="jform[meal5b]" class="w76">
                                        <?php
selectpair(15,23,$meal5[1]);
?>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="col-wra">
                            <p class="mt5">Er det vigtigt, at den kost du indtager, er varierende og smagsfuld?</p>
                            <div>
                                <input class="ra" type="radio" name="jform[diversity]" value="-1">
                                Ikke vigtigt<br class="mb10">
                                <input class="ra" type="radio" name="jform[diversity]" value="1">
                                Meget vigtigt<br class="mb10">
                                <input class="ra" type="radio" name="jform[diversity]" value="0">
                                Ingen af delene </div>
                        </div>
                    </div>
                    <div class="colum bor fr m-h">
                        <div>Mulige kostvaner:</div>
                        <div>Hvor meget tid vil du ca. bruge<br>
                            på at lave mad pr. dag?</div>
                        <div class="fr">
                            <select class="w76" name="jform[cooktime]" style="margin-left: 10px">
                                <option value="0">0 min</option>
                                <option value="30">30 min</option>
                                <option value="45">45 min</option>
                                <option value="60">60 min</option>
                                <option value="90">90 min</option>
                                <option value="120">2 timer</option>
                                <option value="180">+3 timer</option>
                            </select>
                        </div>
                        <div class="mt8">Hvilke fødevarer kan du lide?</div>
                        <div class="clear"></div>
                        <?php
$fav=explode("-",$fav);
$fav[0]= explode(",", $fav[0]);
$fav[1]=explode(",", $fav[1], count($fav[0]));
$fav=array_combine($fav[0], $fav[1]);
?>
                        <div class="w115 fl">
                            <label class="w73 fl">Kylling</label>
                            <input class="ck" type="checkbox" name="jform[fav][0]" value="Kylling"<?php echo $fav[0] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl ml30">
                            <label class="w73 fl">Rodfrugter</label>
                            <input class="ck" type="checkbox" name="jform[fav][1]" value="Rodfrugter"<?php echo $fav[1] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl">
                            <label class="w73 fl">Oksekød</label>
                            <input class="ck" type="checkbox" name="jform[fav][2]" value="Oksekød"<?php echo $fav[2] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl ml30">
                            <label class="w73 fl">Chili</label>
                            <input class="ck" type="checkbox" name="jform[fav][3]" value="Chili"<?php echo $fav[3] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl">
                            <label class="w73 fl">Svinekød</label>
                            <input class="ck" type="checkbox" name="jform[fav][4]" value="Svinekød"<?php echo $fav[4] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl ml30">
                            <label class="w73 fl">Proteinpulver</label>
                            <input class="ck" type="checkbox" name="jform[fav][5]" value="Proteinpulver"<?php echo $fav[5] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl">
                            <label class="w73 fl">Brune ris</label>
                            <input class="ck" type="checkbox" name="jform[fav][6]" value="Brune ris"<?php echo $fav[6] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl ml30">
                            <label class="w73 fl">Æg</label>
                            <input class="ck" type="checkbox" name="jform[fav][7]" value="Æg"<?php echo $fav[7] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl">
                            <label class="w73 fl">Grønne bønner</label>
                            <input class="ck" type="checkbox" name="jform[fav][8]" value="Grønne bønner"<?php echo $fav[8] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl ml30">
                            <label class="w73 fl">Fisk</label>
                            <input class="ck" type="checkbox" name="jform[fav][9]" value="Fisk"<?php echo $fav[9] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl">
                            <label class="w73 fl">Ost</label>
                            <input class="ck" type="checkbox" name="jform[fav][10]" value="Ost"<?php echo $fav[10] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl ml30">
                            <label class="w73 fl">Nødder</label>
                            <input class="ck" type="checkbox" name="jform[fav][11]" value="Nødder"<?php echo $fav[11] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl">
                            <label class="w73 fl">Hakket kød<br>
                                (svin/kalvekød/<br>
                                okse)</label>
                            <input class="ck" type="checkbox" name="jform[fav][12]" value="Hakket kød (svin/kalvekød/okse)"<?php echo $fav[12] ? ' checked=""':""?>>
                        </div>
                        <div class="w115 fl ml30">
                            <label class="w73 fl">Mælkeprodukter<br>
                                (ymer, fromage<br>
                                frais etc.)</label>
                            <input class="ck" type="checkbox" name="jform[fav][13]" value="Mælkeprodukter (ymer, fromage frais etc.)"<?php echo $fav[13] ? ' checked=""':""?>>
                        </div>
                        <div>Er du allergisk overfor nogle<br>
                            fødevarer?</div>
                        <?php if($allergy){?>
                        <div class="fr">
                            <label class="uper">Ja/Nej</label>
                            <input class="ra" type="radio" name="r5" value="1" checked>
                            <input class="ra" type="radio" name="r5" value="">
                        </div>
                        <div class="clear"></div>
                        <div id="opt5" style="float: none">
                            <label class="fl ita w100">Hvis ja, hvad?</label>
                            <input class="w86" name="jform[allergy]" value="<?php echo $allergy?>">
                        </div>
                        <?php }else{?>
                        <div class="fr">
                            <label class="uper">Ja/Nej</label>
                            <input class="ra" type="radio" name="r5" value="1">
                            <input class="ra" type="radio" name="r5" value="" checked>
                        </div>
                        <div class="clear"></div>
                        <div id="opt5" class="hide" style="float: none">
                            <label class="fl ita w100">Hvis ja, hvad?</label>
                            <input class="w86" name="jform[allergy]">
                        </div>
                        <?php }?>
                    </div>
                    <div class="clear"></div>
                    <a class="fl bntPrevious" href="<?php echo JRoute::_('index.php?option=com_users&view=profile&layout=edit&Itemid=117')?>">Forrige</a> <a class="fr bntNext" onclick="$('#member-edit').submit()">Næste</a>
                    <input type="hidden" name="option" value="com_users" />
                    <input type="hidden" name="task" value="profile.edit" />
                    <input type="hidden" name="user_id" value=<?php echo $user->id?> />
                    <?php echo JHtml::_('form.token');?>
                </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
var f2=document.reg_form2;
	$(document).ready(function(){
		$("input[name=r1]").change(function() {
			$("#opt1").toggle();
			if(!$(this).val())
				f2.elements["jform[breakfast]"].value="";
		});

		$("input[name=r2]").change(function() {
			$("#opt2").toggle();
			if(!$(this).val())
				f2.elements["jform[soda]"].value="";
		});

		$("input[name=r3]").change(function() {
			$("#opt3").toggle();
			if(!$(this).val())
				f2.elements["jform[eatwell]"].value="";
		});

		$("input[name=r4]").change(function(){
			$("#opt4").toggle();
			if(!$(this).val()){
				f2.elements["jform[roiloan]"][0].checked=false;
				f2.elements["jform[roiloan]"][1].checked=false;
			}
		});

		$("input[name=r5 ]").change(function() {
			$("#opt5").toggle();
			if(!$(this).val())
				f2.elements["jform[allergy]"].value="";
		});
	});
<?php
	echo 'f2.elements["jform[diversity]"].value=',$diversity,';';
	echo 'f2.elements["jform[cooktime]"].value=',$cooktime,';';
?>
</script>